using System;
using System.Collections.Generic;
using System.Linq;

namespace RFS.Domain.PaiShi.WorkFlow
{
    public class WorkFlowNodeWrapper : IWorkFlowNodeWrapper
    {
        public WorkFlowNodeWrapper(WorkFlowNode node )
        {
            WorkFlowNode=node;
            
        }
        public WorkFlowNodeWrapper(IEnumerable<IOrderItem> ors=default,DateTime bd=default, string nodeName="")
        {
            var n=new WorkFlowNode(ors,bd , nodeName:nodeName);
            WorkFlowNode=n;
        }

        public WorkFlowNodeWrapper( )
        {
        }

        public override string ToString()
        {
            return  $"{WorkFlowNode.KeyName}:{WorkFlowNode.Quantiy} 枝";
        }

        public IProblem Problem { get; set; } = new ProblemClass();
        public IWorkFlowNode WorkFlowNode { get; set; } = new WorkFlowNode();
        public bool IsEmpty { get=>WorkFlowNode==null?false:WorkFlowNode.IsEmpty; }

        public string KeyNote
        {
            get =>$"{this.WorkFlowNode}" ; }

        public IEnumerable<IOrderItem> DateItems { get=>WorkFlowNode.OrderItems; }
        public BizFlowNodeEnum NodeBizType { get; set; }

        public IEnumerable<IOrderItem> GetUnRecordedItems (){  return WorkFlowNode.GetUnRecordedItems.ToList();  }
        public void ClearData()
        {

            WorkFlowNode.Clear();
        }
    }
}